home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 57 < prev    next >
Text File  |  1996-08-06  |  843b  |  32 lines

  1. Path: funcom.no!news
  2. From: eivind@odin.funcom.com (Eivind Eklund)
  3. Newsgroups: comp.std.c
  4. Subject: int's and zero
  5. Date: 9 Jan 1996 10:47:42 GMT
  6. Organization: Funcom Productions.
  7. Message-ID: <4cth4e$4q@odin.funcom.no>
  8. NNTP-Posting-Host: odin.funcom.no
  9. X-Newsreader: knews 0.9.3
  10.  
  11. Are zero in an integer required to be represented by binary zeros?
  12. I know it is not required for floats and pointers, so memset()ing a 
  13. structure to 8-bit zeros are not correct if it contain pointers or 
  14. floating point values, but what about integers? Ie, if I have
  15.  
  16. struct intstruct {
  17.   int a;
  18.   long b;
  19.   short c;
  20. };
  21. ..
  22. struct intstruct teststruct;
  23. memset(&teststruct, 0, sizeof(teststruct));
  24.  
  25. Is teststruct.a, teststruct.b, and teststruct.c guaranteed to be == 0?
  26.  
  27. -- 
  28. Eivind Eklund
  29. eivind.eklund@funcom.com
  30. FUNCOM don't speak for me, and I return the courtesy.
  31.  
  32.